using System;

namespace Sedna.Core.Controller.Configurations
{
	public class DateRangeConfiguration: ClientScriptingConfiguration, IDateRangeConfiguration, IBusinessDaySelector
	{
		private string toDateBindPath;
		private string toDateUnbindPath;
		private string fromDateBindPath;
		private string fromDateUnbindPath;
		private string selectHolidayBindPath;

        private IDatePickerConfiguration fromDateConfiguration;
        private IDatePickerConfiguration toDateConfiguration;
	    private bool allowNull;
	    private bool allowManualEnter;

	    public IDatePickerConfiguration FromDateConfiguration
	    {
	        get { return fromDateConfiguration; }
	        set { fromDateConfiguration = value; }
	    }

	    public IDatePickerConfiguration ToDateConfiguration
	    {
	        get { return toDateConfiguration; }
	        set { toDateConfiguration = value; }
	    }

	    public string ToDateBindPath
		{
			get { return toDateBindPath; }
			set { toDateBindPath = value; }
		}

		public string ToDateUnbindPath
		{
			get { return toDateUnbindPath; }
			set { toDateUnbindPath = value; }
		}

		public string FromDateBindPath
		{
			get { return fromDateBindPath; }
			set { fromDateBindPath = value; }
		}

		public string FromDateUnbindPath
		{
			get { return fromDateUnbindPath; }
			set { fromDateUnbindPath = value; }
		}
	
		public string FromDatePath
		{
			set
			{
				fromDateBindPath=value;
				fromDateUnbindPath=value;
			}
		}

		public string ToDatePath
		{
			set
			{
				toDateBindPath=value;
				toDateUnbindPath=value;
			}
		}

		public string SelectHolidayBindPath
		{
			get
			{
				return selectHolidayBindPath;
			}
			set
			{
				selectHolidayBindPath = value;
			}
		}

	    public bool AllowManualEnter
	    {
	        get { return allowManualEnter; }
	    }

	    public bool AllowNull
	    {
	        get { return allowNull; }
	    }

	    public override IConfiguration CreateFromTemplate()
	    {
	        DateRangeConfiguration that = (DateRangeConfiguration) base.CreateFromTemplate();
            that.FromDateConfiguration = FromDateConfiguration;
	        that.ToDateConfiguration = ToDateConfiguration;
            that.FromDateBindPath = FromDateBindPath;
            that.FromDateUnbindPath = FromDateUnbindPath;
            that.SelectHolidayBindPath = SelectHolidayBindPath;
            that.ToDateBindPath = ToDateBindPath;
            that.toDateUnbindPath = ToDateUnbindPath;
            return that;
	    }
	}
}
